<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

require 'route/account.php';
require 'route/admin.php';
require 'route/terminal.php';


/*** 开放平台开始 ***/
Route::group(function (){
    Route::rule('open/event','openplatform/event');
    Route::rule('open/message/appid/:appid','openplatform/message');
    Route::rule('open/message','openplatform/message');
    Route::rule('open/ticket','openplatform/ticket');
});
/*** 开放平台结束 ***/

Route::group(function (){
    Route::rule('/authLogin','ShopManageAuth/authLogin');
    Route::rule('/upload','Upload/upload'); //新上传接口
    Route::rule('/siteInfo','Site/getSiteInfo'); //站点信息
});
/**********平台支付相关*************/
Route::group(function (){ //支付回调
    Route::rule('/respond','payment/respond');
});
Route::group(function (){
    Route::rule('/smsOrder','payment/sms'); //短信充值
    Route::rule('/appOrder','payment/app'); //应用程序续费
    Route::rule('/paymentStatus','payment/check'); //支付状态查询前端提示
})->middleware(\app\platform\middleware\Check::class);
/**********平台支付相关*************/

/**********小程序授权及上传代码*************/
Route::group(function (){
    Route::rule('miniapp/getShopInfo','miniapp/getShopInfo');
    Route::rule('miniapp/getAuth','miniapp/getAuth'); // 授权小程序
    Route::rule('miniapp/callBack','miniapp/callBack'); // 小程序回调
    Route::rule('miniapp/getMpappAuth','miniapp/getMpappAuth'); // 授权公众号
    Route::rule('miniapp/mpcallBack','miniapp/mpcallBack'); // 公众号回调
    Route::rule('miniapp/getCategories','miniapp/getCategories');
    Route::rule('miniapp/uploadCode','miniapp/uploadCode');
    Route::rule('miniapp/submit','miniapp/submit');
    Route::rule('miniapp/back','miniapp/back');
    Route::rule('miniapp/online','miniapp/online');
    Route::rule('miniapp/getTestQrcode','miniapp/getTestQrcode');
    Route::rule('miniapp/getQrcode','miniapp/getQrcode');
    
})->middleware(\app\platform\middleware\Check::class);

Route::group(function (){ //小程序二维码显示的地址
   Route::rule('miniapp/testQrcodeImg','miniapp/testQrcodeImg');
   Route::rule('miniapp/qrcodeImg','miniapp/qrcodeImg'); 
});
/**********结束*****************/

Route::get('/','index/index');

Route::miss(function() {
    return '404！您访问的地址不存在！';
});